import { WHETHER_OPTIONS } from '@/constants/basics';

import {
  ReqSourceEnums,
  DevStatusEnums,
  DevTypeEnums
} from '../../constants/enums'

export const REQ_SOURCE_OPTIONS = ReqSourceEnums.options // 需求来源下拉
export const DEV_STATUS_OPTIONS = DevStatusEnums.options // 开发状态下拉
export const DEV_TYPE_OPTIONS = DevTypeEnums.options // 开发类型下拉

export const DEV_STATUS_VALUES = DevStatusEnums.values // 开发状态枚举
export const DEV_TYPE_VALUES = DevTypeEnums.values // 开发类型枚举

export const FORM_ITEMS = [
  {
    prop: 'categoryPath',
    label: '品类',
    type: 'input',
  },
  {
    prop: 'brandName',
    label: '品牌',
    type: 'input'
  },
  {
    prop: 'reqNo',
    label: '需求单号',
    type: 'input'
  },
  {
    prop: 'reqDetailNo',
    label: '需求编号',
    type: 'input'
  },
  {
    prop: 'source',
    label: '需求来源',
    type: 'select',
    options: REQ_SOURCE_OPTIONS,
    clearable: true
  },
  {
    prop: 'devStatus',
    label: '开发状态',
    type: 'select',
    options: DEV_STATUS_OPTIONS,
    defaultVal: DEV_STATUS_VALUES.Pending,
    clearable: true
  },
  {
    prop: 'devType',
    label: '开发类型',
    type: 'select',
    options: DEV_TYPE_OPTIONS,
    clearable: true
  },
  {
    prop: 'createOpeTime',
    label: '创建日期',
    type: 'datePicker',
    valueFormat: 'yyyy-MM-dd HH:mm:ss',
    timeKeys: ['createOpeStartTime', 'createOpeEndTime']
  },
  {
    prop: 'sponsorAreaName',
    label: '发起区域',
    type: 'input'
  },
  {
    prop: 'belongCenterName',
    label: '归属中心',
    type: 'input'
  },
  {
    prop: 'acceptorName',
    label: '需求受理人',
    type: 'input'
  },
  {
    prop: 'isRepeatDev',
    label: '是否重复开发',
    type: 'select',
    options: WHETHER_OPTIONS
  }
]

export const TABLE_COLUMNS = [
  {
    title: '需求单号',
    key: 'reqNo',
    width: 150
  },
  {
    title: '需求编号',
    key: 'reqDetailNo'
  },
  {
    title: '需求来源',
    key: 'sourceStr'
  },
  {
    title: '开发状态',
    key: 'devStatusStr'
  },
  {
    title: '开发类型',
    key: 'devTypeStr'
  },
  {
    title: '创建日期',
    key: 'createOpeTime',
    width: 150
  },
  {
    title: '发起人',
    key: 'sponsorName'
  },
  {
    title: '发起部门',
    key: 'sponsorDeptName',
    width: 150
  },
  {
    title: '发起区域',
    key: 'sponsorAreaName',
    width: 150
  },
  {
    title: '归属中心',
    key: 'belongCenterName',
    width: 150
  },
  {
    title: '归属部门',
    key: 'belongDeptName',
    width: 150
  },
  {
    title: '行业',
    key: 'industryPath'
  },
  {
    title: '品类树',
    key: 'categoryPath',
    width: 300
  },
  {
    title: '档次',
    key: 'gradeStr'
  },
  {
    title: '品牌',
    key: 'brandName'
  },
  {
    title: '商品名称',
    key: 'productName'
  },
  {
    title: '预计销量(万元)',
    key: 'expectedSales'
  },
  {
    title: '备注',
    key: 'remark'
  },
  {
    title: '是否重复开发',
    key: 'isRepeatDevStr'
  },
  {
    title: '订货频次',
    key: 'orderFrequency'
  },
  {
    title: '订货金额',
    key: 'orderAmount'
  },
  {
    title: '需求受理人',
    key: 'acceptorName'
  },
  {
    title: '计划开发创建时间',
    key: 'planCreateOpeTime',
    width: 150
  },
  {
    title: '开发计划单号',
    key: 'planNo',
    width: 150
  },
  {
    title: '开发部门',
    key: 'devDeptName',
    width: 150
  },
  {
    title: '开发区域',
    key: 'devAreaName',
    width: 150
  },
  {
    title: '暂不开发原因',
    key: 'notDevReason'
  },
  {
    title: '取消开发原因',
    key: 'cancelReason'
  }
]

export const SESSION_KEY = 'develop-requirement-pool-reqdetailnos'
